<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鼠标悬停事件</title>
    <style>
        .hover{
            width: 200px;
            height: 200px;
            border: 1px solid lime;
        }
    </style>
</head>
<body>
<div class="hover" onmouseover="over()" onmouseleave="leave(this)" style="background-color: pink">

</div>
<script>
    function over() {
        var d=document.getElementsByClassName("hover")[0];
        console.log("aaaaaa");
       d.style.backgroundColor="red";
    }
    function leave(e) {
        console.log("bbbbbb");
        e.style.backgroundColor="aqua";
    }
</script>
</body>
</html>